home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / SWI / source / src / defatom.awk < prev    next >
Encoding:
AWK Script  |  1997-08-07  |  369 b   |  15 lines

  1. BEGIN    { atom = functor = 0;
  2.     }
  3. /^#/    { next;
  4.     }
  5. /^A/    { printf "#define ATOM_%-12s MK_ATOM(%d)\n",$2,atom  > "pl-atom.ih"
  6.       printf "ATOM(%s),\n",$3  > "pl-atom.ic"
  7.       atom++;
  8.       next;
  9.     }
  10. /^F/    { name = $2 $3;
  11.       printf "#define FUNCTOR_%-12s MK_FUNCTOR(%d, %d)\n",name,functor,$3 > "pl-funct.ih"
  12.       printf "FUNCTOR(ATOM_%s, %d),\n",$2,$3 > "pl-funct.ic"
  13.       functor++;
  14.     }
  15.